<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="${root!}/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="${root!}/lib/js/md5.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>点餐系统管理平台</title>
<script type="text/javascript">
function Login_Submit(){
if($('#TxtUserName').val().trim() == ''){
	alert('温馨提示：用户名不能为空！')
	return;
}else if( $('#TxtPassword').val().trim() == ''){
	alert('温馨提示：密码不能为空！');
}else{
		$.ajax({
			url:'${root!}/common/loginSubmit',
			type:'post',
			dataType:'json',
			data:{
				'username':$('#TxtUserName').val(),
				'password':hex_md5($('#TxtPassword').val())
			},
			success: function(data) {
				if (data.msg == "success") {
					location.href = "${root!}/sys/index"; //如果登录成功则跳到管理界面				 				
				 }else if (data.msg == "fail") {
					 alert("温馨提示：用户名或密码错误！");
				 }else if(data.msg == "unabled"){
					alert("温馨提示：用户不存在或被禁用！");
				 }else{
					alert("温馨提示：登录异常！");
				 }
			},
			error: function (XMLHttpRequest, textStatus, thrownError) { alert("连接错误");}
		});
	} 
}
$(document).keydown(function (e){
	if (e.keyCode == 13){
		Login_Submit();
	}
});	
function shut(){
	window.close();
}
function change(obj, src){
	obj.style.backgroundImage = 'url(/lib/images/sys/background.png)';
	alert(obj.style.backgroundImage);
}

</script>
<style>
*{margin:0;padding:0; font-family:"宋体";font-size:12px;}
body{
	background-image: url(${root!}/lib/images/sys/background.png);
	}
li{ list-style:none;}
.box{
	width:1000px;
	margin:auto;
	position:relative;
	}
.logo{
	background-image: url(${root!}/lib/images/sys/logo.png);
	background-repeat:no-repeat;
	width:405px;
	height:58px;
	position:absolute;
	left:107px;
	top:48px;
	}
.login{
	background-image: url(${root!}/lib/images/sys/login.png);
	background-repeat:no-repeat;
	width:352px;
	height:256px;
	position:relative;
	position:absolute;
	left:542px;
	top:220px;
	}
.author{
	position:absolute;
	left:610px;
	top:480px;
	color:#acacac;
	}
.picture{
		background-image: url(${root!}/lib/images/sys/perture.png);
	background-repeat:no-repeat;
	width:425px;
	height:250px;
	position:absolute;
	left:107px;
	top:202px;
	}
.bottombox1{
	overflow:hidden;
	}
.people{
	background-image: url(${root!}/lib/images/sys/people.png);
	background-repeat:no-repeat;
	width:179px;
	height:36px;
	padding-left:45px;
	text-align:centen;
	font-size:12px;
	line-height:36px;
	border:0;
	position:absolute;
	left:69px;
	top:88px;}
.key{
	background-image: url(${root!}/lib/images/sys/key.png);
	background-repeat:no-repeat;
	width:179px;
	height:36px;
	padding-left:45px;
	text-align:centen;
	font-size:12px;
	line-height:36px;
	border:0;
	position:absolute;
	left:69px;
	top:130px;
	}
.people:hover{
	background-image: url(${root!}/lib/images/sys/people1.png);
	background-repeat:no-repeat;
	width:179px;
	height:36px;
	padding-left:45px;
	text-align:centen;
	font-size:12px;
	line-height:36px;
	border:0;
	position:absolute;
	left:69px;
	top:88px;}
.key:hover{
	background-image: url(${root!}/lib/images/sys/key1.png);
	background-repeat:no-repeat;
	width:179px;
	height:36px;
	padding-left:45px;
	text-align:centen;
	font-size:12px;
	line-height:36px;
	border:0;
	position:absolute;
	left:69px;
	top:130px;
	}
.savekey{
	/* background-image: url(${root!}/lib/images/sys/savekey.png);
	background-repeat:no-repeat; */
	width:114px;
	height:21px;
	position:absolute;
	left:69px;
	top:190px;
		}

.loginon{
	background-image: url(${root!}/lib/images/sys/loginon1.png);
	background-repeat:no-repeat;
	width:60px;
	height:25px;
	position:absolute;
	left:218px;
	top:190px;
	border:0;
		}
.loginon:hover{
	background-image: url(${root!}/lib/images/sys/loginon.png);
	background-repeat:no-repeat;
	width:60px;
	height:25px;
	position:absolute;
	left:218px;
	top:190px;
		}
span{color:#acacac}
</style>
</head>

<body>

<div class="box">
	<div class="logo"></div>
    <div class="picture"></div>
    <div class="login">
		<div><input maxLength=20 id=TxtUserName class="people" /></div>  
        <div><input type=password id=TxtPassword  class="key"/></div>
        <!-- <div class="savekey">
        <span sytle="color:#999999">记住密码：</span>
        <select name="remember" id="remember">
        	<option value="y">是</option>
        	<option value="n">否</option>
        </select>
        </div> -->
        <div class="loginon"
						id=IbtnEnter
						
						onclick='Login_Submit()' 
						 name=IbtnEnter />  </div>
         </div>
	<div class="author">Copyright © 2014 </div>
	
</div>
</div>
</body>
</html>
